package com.awesome.javademo.annotation.lws;

import com.awesome.common.util.log.ShowLogUtil;

import java.lang.reflect.Method;

/**
 * Author: zhangjingfang
 * Email:zhangjingfang@jeejio.com
 * Date: 2022/7/5
 * Description: 运行时注解处理器
 */
public class RuntimeProcessor {
    public static void main() {
        Method[] methods = AnnotationTest.class.getDeclaredMethods();
        for (Method m : methods) {
            GET get = m.getAnnotation(GET.class);
            if (get != null)
                ShowLogUtil.info("GET.value()=" + get.value());
            Swordsman swordsman = m.getAnnotation(Swordsman.class);
            if (swordsman != null)
                ShowLogUtil.info("Swordsman.name()=" + swordsman.name() + ",Swordsman.age()=" + swordsman.age());
        }
    }
}
